echo CHECK OUTPUT DIR!!
echo `pwd`

if ! [ -d output ] ; then
	mkdir output
else
	rm -f ./output/*
fi
echo ====== BUILD ZIP contains com.apk ======
sdk_home=${ANDROID_SDK_HOME}
sdk_home_new="sdk.dir="${sdk_home//\//\\/}
echo $sdk_home_new
sed -i "s/.*sdk.dir.*/$sdk_home_new/g" ./local.properties
${ANT_HOME}/bin/ant clean
${ANT_HOME}/bin/ant release
#${ANT_HOME}/bin/ant -f build.xml release
#rm -f aBuild_ubuntu.pl
#svn export https://svn.baidu.com/scm/trunk/release/buildscript/aBuild_ubuntu.pl
#perl aBuild_ubuntu.pl -a sdkbuild -p TakeoutComponent -t android-19 -v release --no-findbugs
#perl aBuild_ubuntu.pl -a comsdkbuild -p comzuche -t android-19 -v release --no-findbugs
#perl aBuild_ubuntu.pl -a release


echo ====== CHECK OUTPUT FILE ======
echo `pwd`
ls -al 
echo ==================debug begin baigc  project.properties====================================================
#cat /home/scmtools/buildkit/android-sdk/tools/ant/build.xml
cat project.properties
echo ==================baigc middle first   local.properties===================
cat local.properties
echo ==================baigc middle second  build.xml===================
cat build.xml
echo ==================baigc middle third  build.cfg===================
cat build.cfg
echo ==================baigc middle fourth  custom_rules.xml===================
cat custom_rules.xml
echo ==================debug end baigc==========================================================================
ls -al ./bin
files=$(ls ./bin/*car*.zip | wc -l)

if [ "$files" != "0" ] ; then
	echo CHECK Component ZIP FILES OK!!
else
	echo CHECK Component ZIP FILES ERROR!! NOW EXIT!!
	exit 1
fi
echo ====== COPY OUTPUT FILES ======
ls -al ./..
ls -al ./../../
cp -rf ./bin/*.zip  ./../output/
